package com.irs.controller;


import com.irs.pojo.BuildingVideo;
import com.irs.service.BuildingVideoService;
import com.irs.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Component
public class BuildingVideoController {
    @Autowired
    private BuildingVideoService buildingVideoService;

    @GetMapping("/videos/list")
    public String tobuildingVideo(){
        //跳转到buildHouse.jsp
        return "page/audio/buildingVideo";
    }
    //查
    @GetMapping("/audio/video/list")
    @ResponseBody
    public Object BuildingVideo(){
        List<BuildingVideo> buildingVideoList = buildingVideoService.select(new BuildingVideo());
        //返回JSON
        return  ResultUtil.ok(buildingVideoList, buildingVideoList.size());
    }
}
